home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 43 / 043.d81 / video poker (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  6KB  |  139 lines

  1. 10 ifx=0thenx=1:load"video poker.ml",8,1
  2. 20 poke53280,4:gosub1190:cl=54272:vl=cl+24:dimz$(15):fora=cltovl:pokea,0:next
  3. 30 n$="":g$="                    ":pokevl,8
  4. 40 fora=1to15:readb,c,d,z$(a):e=int((40-len(z$(a)))/2):f=40-len(z$(a))-e-2
  5. 50 iff<0thenf=0
  6. 60 ifa=5thenz$(a)=z$(a)+chr$(58)
  7. 70 z$(a)=left$(g$,e)+z$(a)+left$(g$,f):printchr$(c);:poke198,.
  8. 80 forg=1to38:printleft$(n$,b)""right$(z$(a),g)
  9. 85 if(peek(198)>.)and(a>2)thena=15:g=38
  10. 90 tn=32:t1=17:ifa=2ora=4ora=15thentn=16:t1=33
  11. 100 pokecl,128:pokecl+1,d:pokecl+4,tn:ifleft$(right$(z$(a),g),1)=" "then130
  12. 110 ifleft$(right$(z$(2),g),1)="c"then130
  13. 120 pokecl+5,136:pokecl+6,136:pokecl+4,t1
  14. 130 next:ifa=2thengosub1070
  15. 140 z$(a)=mid$(z$(a),4,28):z$(a)=""+z$(a):next:pokecl+4,0:fora=1to100:next
  16. 150 gosub1190:poke198,0:printleft$(n$,5)tab(6)"how many players (1 to 4)?
  17. 160 [161]s$:[139]s$[178]""[167]160
  18. 170 nm[178][197](s$):[139]nm[179]1[176]nm[177]4[167]150
  19. 180 [141]1190:[129]a[178]1[164]nm:[153]"name of player"a"= ";:[133]nm$(a)
  20. 185 [139]nm$(a)[178]""[167]180
  21. 190 [129]rj[178]1[164][195](nm$(a)):[139][201](nm$(a),1)[177][199](64)[175][201](nm$(a),1)[179][199](91)[167]210
  22. 200 nm$(a)[178][200](nm$(a),[195](nm$(a))[171]1)
  23. 210 [130]rj:[139][195](nm$(a))[177]16[167]nm$(nm)[178][200](nm$(nm),16)
  24. 220 [130]:[134]j%(13,4):b$[178][200](n$,20):jw$[178][200](n$,10):x[178][187]([171]ti)
  25. 230 [129]a[178]1[164]nm:sc$(a)[178]" $0":[130]
  26. 240 [141]1150:wx[178]101
  27. 250 dk$[178]"                                     ":d$[178]b$[170]dk$:e$[178][200](n$,15)
  28. 260 hd[178]hd[170]1:[129]tr[178]1[164]nm:[141]1010:[141]1190
  29. 270 [153][200](n$,5)[166]13)"hit kwait to keep"
  30. 280 [153][200](n$,7)[166]12)"hit cwait to change":[141]1090:dc[178]10
  31. 285 [153]"            clrpress q to quit":[129]k[178]1[164]5
  32. 290 x[178][181]([187](1)[172]13)[170]1:y[178][181]([187](1)[172]4)[170]1:[139]j%(x,y)[178]1[167]290
  33. 300 j%(x,y)[178]1:b4[178]32:cr[178]144:[151]781,x:[151]782,y
  34. 310 [158]49333:c4[178][194](782):a4[178][194](781):[139]x[178]10[167]b4[178]48
  35. 320 [139]y[178]3[176]y[178]1[167]cr[178]28
  36. 330 [139]x[178]1[167]x[178]14
  37. 340 [139]k[177]5[167][142]
  38. 350 pt(k)[178]x:st(k)[178]y:[153][200](n$,dc)[163]8[172]k[171]7);:[141]830:[139]h$[178]"y"[167][142]
  39. 360 [130]:[151]198,0:[153]d$:[153]b$[163]13)"keep or change?":[129]dk[178]1[164]5:[141]950:[139]ct[179]rr[167][130]
  40. 370 dc[178]10:[129]ua[178]1[164]5
  41. 380 [139]a(ua)[177]0[167]k[178]ua:a4[178]a(ua):b4[178]b(ua):c4[178]c(ua):d4[178]32:cr[178]cr(ua):[141]830
  42. 390 [130]:[153]d$e$dk$:[129]a[178]1[164]5:a(a)[178]0:b(a)[178]0:c(a)[178]0:[151](1015[170]a),pt(a):[130]
  43. 400 [158]49242:[129]a[178]1[164]5:pt(a)[178][194](1015[170]a):[130]
  44. 410 [139]pt(5)[171]pt(4)[178]1[167][139]pt(4)[171]pt(3)[178]1[167][139]pt(3)[171]pt(2)[178]1[167][139]pt(2)[171]pt(1)[178]1[167]ss[178]1
  45. 420 [139]st(1)[178]st(2)[167][139]st(2)[178]st(3)[167][139]st(3)[178]st(4)[167][139]st(4)[178]st(5)[167]fl[178]1
  46. 430 [158]49294:xe[178][194](1011):zq[178][194](1012):z$[178]"             you lost!!"
  47. 440 [139]pt(1)[178]pt(2)[167][139]pt(1)[178]pt(3)[167][139]pt(1)[178]pt(4)[167]fr[178]1
  48. 450 [139]pt(5)[178]pt(4)[167][139]pt(5)[178]pt(3)[167][139]pt(5)[178]pt(2)[167]fr[178]1
  49. 460 [139]ss[178]1[167][139]fl[178]1[167][139]pt(5)[178]14[167]mn[178]249:z$[178]z$(6):[137]560
  50. 470 [139]ss[178]1[167][139]fl[178]1[167]mn[178]99:z$[178]z$(7):[137]560
  51. 480 [139]fr[178]1[167]mn[178]19:z$[178]z$(8):[137]560
  52. 490 [139]zq[178]4[167][139]fr[179][177]1[167]mn[178]9:z$[178]z$(9):[137]560
  53. 500 [139]fl[178]1[167]mn[178]7:z$[178]z$(10):[137]560
  54. 510 [139]ss[178]1[167]mn[178]4:z$[178]z$(11):[137]560
  55. 520 [139]zq[178]3[167]mn[178]3:z$[178]z$(12):[137]560
  56. 530 [139]zq[178]2[167]mn[178]2:z$[178]z$(13):[137]560
  57. 540 [139]zq[178]1[167][139]xe[177][178]11[167]z$[178]z$(14):mn[178]0
  58. 550 [139][202](z$,20,1)[178]"l"[167]qp[178]1:mn[178][171]1
  59. 560 sc(tr)[178]sc(tr)[170]mn
  60. 570 ds[178]16:[141]1090:[153]"clr":[139]qp[178]1[167][153]"stop":ds[178]32
  61. 580 [129]a[178]1[164]5:[153]b$z$:ww[178]20:[129]b[178]135[164]243[169]12:[139]qp[178]1[167][129]b[178]243[164]135[169][171]12:ww[178]32
  62. 590 [151]cl[170]4,ds[170]1:[151]cl[170]1,b:[151]cl,b:[129]c[178]1[164]ww:[130]:[130]:[151]cl[170]4,ds:[153]d$:[129]d[178]1[164]100:[130]:[130]
  63. 600 [129]x[178]1[164]13:[129]y[178]1[164]4:j%(x,y)[178]0:[130]:[130]:k[178]0
  64. 610 [129]a[178]1[164]5:pt(a)[178]0:st(a)[178]0:[130]:ss[178]0:fl[178]0:zq[178]0:fr[178]0:xe[178]0:qp[178]0:ct[178]0:ua[178]0
  65. 620 [129]a[178]1[164]1500:[130]:h$[178]"":[139]mn[179]2[167]820
  66. 630 [141]1190:[151]53280,2:[153]""[163]12)"hi-lo bonus round
  67. 640 ifh$="y"thenreturn
  68. 650 gosub1090:print"do you want to play bonus (y[146]/n[146])?
  69. 660 [161]h$:[139]h$[178]""[167]660
  70. 670 [139]h$[178]"n"[167]820
  71. 680 [139]h$[179][177]"y"[167]630
  72. 690 dc[178]10:[141]630:[141]1090:k[178]2:[141]290:k[178]4:[141]290
  73. 700 [139][182](pt(2)[171]pt(4))[178]1[176]pt(2)[171]pt(4)[178]0[167]qp[178]1:z$[178]"            you lose $1!"
  74. 710 [139]qp[178]1[167]bt[178]1:[137]800
  75. 720 [153][200](n$,17)[163]13)"payoff is 2:1
  76. 730 mn$=str$(mn)
  77. 740 printleft$(n$,19)tab(6)"enter bet between $1 and $"right$(mn$,len(mn$)-1);
  78. 750 inputja$:bt=int(val(ja$))
  79. 760 print"[145][145][145][145][145]":fora=1to6:printdk$:next:ifbt<1orbt>mnthen740
  80. 770 dc=13:k=3:gosub290:z$="             you lose!!":qp=1
  81. 780 if(pt(3)<pt(4)andpt(3)>pt(2))or(pt(3)>pt(4)andpt(3)<pt(2))thenqp=0
  82. 790 ifqp=0thenz$="             you win!!!":sc(tr)=sc(tr)+2*bt
  83. 800 h$="":ifqp=1thensc(tr)=sc(tr)-bt
  84. 810 mn=0:goto570
  85. 820 nexttr:goto260
  86. 830 wz=wx
  87. 840 wx=int(rnd(1)*128)+25:ifabs(wz-wx)<30then840
  88. 850 wb=wx-64:ifwb<20thenwb=20
  89. 860 x1=a4:x2=b4:x3=c4:x4=cr:a4=166:b4=166:c4=166:d4=166:cr=28:ifua>0then880
  90. 870 gosub920
  91. 880 fora=1to3:pokevl,12:pokecl+1,wb:pokecl,wx:pokecl+4,17:printleft$(n$,dc+1)tab(8*k-6);
  92. 890 gosub930:forb=1to100:next:pokecl+4,16:wb=wb+3:ifa=1thencr=30
  93. 900 ifa=2thencr=31
  94. 910 next:a4=x1:b4=x2:c4=x3:d4=32:cr=x4:printleft$(n$,dc+1)tab(8*k-6);:gosub930:return
  95. 920 print"[144][176][192][192][192][192][174][157][157][157][157][157][157][221]    [221][157][157][157][157][157][157][221]    [221][157][157][157][157][157][157][221]    [221][157][157][157][157][157][157][173][192][192][192][192][189]":return
  96. 930 printchr$(cr)chr$(a4)chr$(b4)chr$(d4)chr$(d4)"[157][157][157][157]"chr$(d4)chr$(c4)chr$(c4)chr$(d4);
  97. 940 print"[157][157][157][157]"chr$(d4)chr$(d4)chr$(a4)chr$(b4):return
  98. 950 printe$spc(dk*8-4)"?":fora=1to100:next:printe$spc(dk*8-4)" ":fora=1to50:next
  99. 960 geth$:ifh$=""then950
  100. 965 ifh$="q"thengosub60000
  101. 970 ifh$="k"thenreturn
  102. 980 ifasc(h$)<>67then950
  103. 990 ct=ct+1:gosub290:pt(dk)=x:st(dk)=y:b(dk)=b4:c(dk)=c4:a(dk)=a4:cr(dk)=cr
  104. 1000 cr=30:a4=166:b4=166:c4=166:d4=166:printleft$(n$,11)tab(8*dk-6);:gosub930:return
  105. 1010 poke53280,8:gosub1190:print""tab(16)"[144]hand"hd:md=((34-len(nm$(tr)))/2)
  106. 1020 printleft$(n$,6)tab(md)""nm$(tr)" is up"::printtab(15)"winnings:
  107. 1030 [129]d[178]1[164]nm:md[178][195](nm$(d)):e[178][195]([196](sc(d)))
  108. 1040 [153]""[163](35[171]md[171]e)[173]2)nm$(d)" ="sc$(d):[130]
  109. 1050 [129]a[178]1[164]4:[129]b[178]0[164]15:[151]53280,b:[129]c[178]1[164]50:[130]:[130]
  110. 1060 [130]:[151]53280,14:[142]
  111. 1070 [158]49364:[129]h[178]1[164]3:[129]i[178]0[164]15:[151]53280,i:[129]j[178]1[164]50:[130]:[130]:[130]
  112. 1080 [151]53280,4:[142]
  113. 1090 md[178][195](nm$(tr)):[153][200](n$,3)[163](25[171]md)[173]2)""nm$(tr)"'s";
  114. 1100 sc$(tr)[178][196](sc(tr))
  115. 1110 sm$[178]" ":[139][200](sc$(tr),1)[178]"-"[167]sm$[178]" -"
  116. 1120 sc$(tr)[178][201](sc$(tr),[195](sc$(tr))[171]1)
  117. 1130 sc$(tr)[178]sm$[170]"$"[170]sc$(tr)[170]"wait  "
  118. 1140 [153]" winnings:"sc$(tr):[142]
  119. 1150 [141]1190:[153]"   max. # of draw cards (1 to 5)?
  120. 1160 getrr$:ifrr$=""then1160
  121. 1170 rr=val(rr$):ifrr<1orrr>5then1150
  122. 1180 return
  123. 1190 print"[147]":poke53281,1:sys49152:return
  124. 1200 data2,144,35,*** video poker ***,3,28,26
  125. 1210 datacopyright 1984-1987 by a. j. kwitowski
  126. 1220 data5,30,32,up to 4 can play ,7,154,35,"hi-lo bonus option on wins over $1 "
  127. 1230 data10,28,32,you win as follows,12,31,30,royal flush = $250
  128. 1240 data13,31,28,straight flush = $100,14,31,26,4 of a kind = $20
  129. 1250 data15,31,24,full house = $10,16,31,22,flush = $8
  130. 1260 data17,31,20,"straight = $5 ",18,31,18,"3 of a kind = $4 "
  131. 1270 data19,31,16,2 pair = $3,20